from marshmallow import fields
from gis.common.django_ext.forms import BaseSchema, PaginationSchema


class AddBulletinSchema(BaseSchema):
    value = fields.String(required=True)
    start_time = fields.DateTime(required=True)
    end_time = fields.DateTime(required=True)
    mch_ids = fields.List(fields.Integer(), allow_none=True)


class GetBulletinSchema(PaginationSchema):
    is_flash = fields.Boolean()
    value = fields.String()
    mch_ids = fields.List(fields.Integer(), allow_none=True)


class UpdateBulletinSchema(BaseSchema):
    value = fields.String(required=True)
    start_time = fields.DateTime(required=True)
    end_time = fields.DateTime(required=True)
    mch_ids = fields.List(fields.Integer(), allow_none=True)
